This page last changed on Oct 03, 2007 by scytacki.

This page is out of date. The ViewHost is replaced with a OTViewContext which provides this functionality.

It is currently difficult to make a simple page that has a model and a button to take a snapshot of the model. The problem is because the button does not have access to the real java object which is the model. The button can easily access the ot-object that represents the model, but to actually take the snapshot it needs the jcomponent of the model.

So to enable scripting like this there needs to be a way for views to get the actual components of sibilings located on a page with them.

The first approach is to create something called a ViewHost all views can access their viewHost. The class will be
OTViewHost
getViewByTag(String tag)
getViewByObject(OTObject obj)

The next issue will be that the button needs to known when a view is refreshed. However to just get started we will add the view host concept.

The ViewHost represents an object above the view-container. A view container holds a single view, it can be used by a view to replace itself with a different view. A ViewHost can have many views. This diagram might help:

Unknown macro: {gliffy}

The view host can't be made available through the viewserviceprovider because that currently comes from the viewFactory, so it wouldn't beable to make a new one for each container.


view host (text/xml)
view host (text/xml)
Document generated by Confluence on Jan 27, 2014 16:52